home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Sapphire Collection
/
Software Vault (Sapphire Collection) (Digital Impact).ISO
/
cdr14
/
apmtst.zip
/
OS2PRT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-09-27
|
4KB
|
117 lines
/****************** IBM Internal Use Only *************************/
/* TRAPTRAP: Process a OS/2 System error box window */
/* ---- Sample program demonstrating APMT ----- */
/* Author: Dev Banerjee (IBM Corporation) */
/* */
/* (C) Copyright IBM Corporation 1994. All rights reserved. */
/* All rights reserved */
/* */
/* Function: */
/* This command will print the contents of the topmost window on */
/* the desktop, IF THAT WINDOW IS A STANDARD OS/2 COMMAND WINDOW. */
/* Normal print screen key prints the prints in graphics format */
/* and is slow. This command will copy the contents to the */
/* clipboard and then to temporary file, and then print it. */
/* To Install: */
/* - Install APMT */
/* - From directory where this file, and OS2PRT.ICO exists, */
/* ENTER 'OS2PRT INSTALL' */
/* - This will create an icon, PrintScreen, on the dekstop. */
/* To Use: */
/* - Make the os/2 window you want to print, the top window */
/* - double click on the icon */
/* */
/* Prereqs: */
/* */
/* APMT rexx function package (OS2EWS) */
/******************************************************************/
Trace off
arg option
if option = 'INSTALL' then do
call install
exit
end
if option \= 'FROMICON' then do
call showhelp
exit
end
/*---- invoked as expected */
call APMT_INIT
rc = SELECT_WINDOW("*")
rc = SET_FOCUS() /* NOT NEEDED, but a nice touch */
rc = SYSMENU_SELECT("Copy All")
if rc > 0 then do
say "This window does not have a 'Copy All' sysmenu item"
say "Not a standard OS/2 text window"
signal APMT_CLOSE
end
if QUERY_CLIPBOARD_TEXT("clip") = 0 then do
'del temp.prt'
do i = 1 to clip.0
trash = lineout("temp.prt",clip.i)
end
trash = lineout("temp.prt")
'print temp.prt'
'del temp.prt'
end
/******************************************************************/
APMT_CLOSE:
rc = END_SESSION();
exit
/******************************************************************/
errorexit:
call DropFUNC
exit
LoadFUNC:
call rxfuncadd 'APMTLoadFuncs', 'apmtext', 'APMTLoadFuncs' /* entry points from the DLL */
call APMTLoadFuncs;
return
DropFUNC:
call APMTDropFuncs;
call rxfuncdrop(APMTDropFuncs)
return
APMT_INIT:
signal on error name errorexit
call rxfuncadd 'APMTLoadFuncs', 'apmtext', 'APMTLoadFuncs' /* entry points from the DLL */
call APMTLoadFuncs;
rc = INIT_SESSION();
if rc \= 0
then do
say apmtmsg
signal errorexit
end
signal on halt name APMT_CLOSE
return
INSTALL:
If RxFuncQuery('SysLoadFuncs') Then Do
Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
Call SysLoadFuncs
End
Sysrc=SysCreateObject("WPProgram","PrintScreen","<WP_DESKTOP>",,
"ICONFILE=OS2PRT.ICO;"||,
"EXENAME=os2prt.cmd;"||,
"PARAMETERS=fromicon;"||,
"PROGTYPE=WINDOWABLEVIO;"||,
"MINIMIZED=YES;"||,
'', 'U');
return
SHOWHELP:
say 'This command will cause a os/2 text window to be printed '
say ''
say 'The proper way to run this command is : '
say ' 1. Make the os/2 text window you want to print, the active window'
say ' 2. Double Click on the PrintScreen icon on the desktop '
say ''
say 'To create the PrintScreen icon on the desktop, enter: '
say ' OS2PRT INSTALL'
return